<?php $this->load->module('mobile/index/header', $common);?>
<style>
    .ranklist img{
        width:45px;
        height:45px;
        float:left;
    }
    .ranklist li{
        display: block;
        border-bottom: 1px solid #c8c7cc;
        height: 70px;
        padding: 12px;
    }


    .wrap{background:#fff}.list{width:100%}
    .list li{height:70px}
    .list a{display: block;height: 50px;line-height: 50px;border-bottom: 1px solid #ECECEC;padding:10px 40px 10px 10px;position: relative}
    .list a span{font-weight:bold}
    .list a em{font-weight:normal;display:block}
    .ctrl{position:absolute;right:10px;top:0}
    .fa-succ:before{line-height:70px;font-size:20px;color:#25AA09;font-weight:bold}
    .blue{color:#025287}
    #loading{ display:none}#loading a{padding:10px;text-align:center}
    .rank_tab .rank-bar-detail{ padding:25px 0; height:100px; }
    .rank_tab .rank-bar-detail .rank-in-wrapper{ width:50%; float:left; text-align:center; box-sizing:border-box; }
    .rank_tab .rank-bar-detail .rank-in-wrapper{ position:relative; z-index:1; }
    .rank_tab .rank-bar-detail .rank-in-wrapper{ border-left:1px solid #ECECEC; }
    .rank_tab .rank-bar-detail .rank-in-wrapper p{ line-height:1.5em; color:#A6A6A6; font-size:13px; }
    .rank_tab .rank-bar-detail .rank-in-wrapper .info-words{ font-size:20px; color:#5A85CE; display:inline-block; min-width:50px; padding:5px; }
    .rank_tab .rank_info{ padding:15px 0 0; box-sizing:border-box; background:#FFF; border-top:1px solid #ECECEC; }
    .rank_tab .rank_info h4{ padding:0 12px; font-size:15px; }
    .rank_tab .rank_list{ padding:15px 15px 20px; box-sizing:border-box; background:#FFF; }
    .rank_tab .rank_list .rank_bar_list > li{ height:70px; clear:left; padding:10px 10px 10px 30px;border-bottom:1px solid #ECECEC }
    .rank_tab .rank_list .rank_bar_list > li .rank_icon, .rank_tab .rank_list .rank_bar_list > li .rank_grade{ display:block; width:50px; height:40px; float:left; }
    .rank_tab .rank_list .rank_bar_list > li .rank_grade{ font-weight:bold; font-size:25px; line-height:40px; /*text-align: center;*/ }
    .rank_tab .rank_list .rank_bar_list > li .rank_bar_face{ float:left; width:40px; height:40px; border-radius:50%; }
    .rank_tab .rank_list .rank_bar_list > li .rank_bar_info_wrap{ margin-left:100px; }
    .rank_tab .rank_list .rank_bar_list > li .rank_bar_info_wrap .rank_bar_name{ font-size:16px; line-height:18px; }
    .rank_tab .rank_list .rank_bar_list > li .rank_bar_info_wrap .rank_bar_today_topic{ font-size:13px; color:#A6A6A6; margin-top:6px; }
    .rank_user{display:block;float:left}
    .rank_bar_today_topic b{padding:0 2px}
    .rank1{color:#FBA41F}
    .rank2{color:#F46751}
    .rank3{color:#5BCAE1}
    .rankn{color:#92B743}
    .log-title{ position:relative; font-size:15px; padding:10px 0 0 0; line-height:15px; }
    .container{ margin:10px; overflow:hidden; }
    .topicBox{ margin-bottom:10px; background-color:#FFF; overflow:hidden; -moz-box-shadow:0 1px 2px #CACACA; -webkit-box-shadow:0 1px 2px #CACACA; box-shadow:0 1px 2px #CACACA; border-radius:2px; padding:10px 10px 8px; position:relative; }
    .ht-tit{ display:-webkit-box; display:-moz-box; display:box; padding-bottom:10px; }
    .htt-img, .htt-img img{ height:45px; width:45px; position:relative; display:block; border-radius:22px; background-size:45px; }
    .ht-tit .htt-content{ padding-left:13px; }
    .ht-tit .htt-content .httc-name{ color:#333; display:block; font-size:14px; }
    .ht-tit .htt-content .httc-info{ padding-top:5px; }
    .ht-content-ellipsis{ overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:7; -webkit-box-orient:vertical; margin-bottom:10px; }
    .time{ font-size:12px; color:#7F7F7F; display:inline-block; }
    .log-info{ background:#F7F7F7; padding:10px 5px; font-size:12px; color:#7F7F7F; }
    .log-info b{ padding:0 2px; color:#5A85CE }
    .gold{ color:#FBA41F !important; background:url("");    display: inline-block;
        height: 20px;
        width: 20px;
        background-size: 20px 20px;
        vertical-align: middle;
        margin-right: 10px;}
</style>
<div class="wrap rank_tab content">
    <div class="rank-bar-detail">
        <div class="rank-in-wrapper ">
            <p><span class="info-words">￥<?php echo $info['cash_commision']?></span></p>
            <p>账户余额</p>
        </div>
        <a class="rank-in-wrapper " onclick="return showpop();">
            <p><span class=" info-words">￥<?php echo $maxmoney?></span></p>
            <p>点击提现</p>
        </a>
    </div>
    <div class="rank_info"><h4><i class="fa-icon fa gold"></i>账户记录</h4></div>
    <div id="rankList" class="rank_list section-1px">
        <ul id="rankBarList" class="rank_bar_list">
        <?php  foreach ($list as $k => $v) {
            ?>
            <li class="clear">
                <a style="float:left"><?php echo $v['remark'] != '提现' ? '返佣' : '提现';?></a>
                <div class="rank_bar_info_wrap">
                    <p class="rank_bar_name">
                        <?php echo $v['remark'] != '提现' ? '' : '-';?><?php echo $v['money']?>
                         <span style="float:right;color:#666;"><?php echo $v['status'] ? '成功' : '申请中';?></span>
                    </p>
                    <p class="rank_bar_today_topic"><?php echo $v['add_time']?></p>
                </div>
            </li>
        <?php
        }
        ?>
    </ul>
    </div>
</div>

<style>
    #confirmw{background:rgba(0,0,0,.5);position:fixed;top:0;left:0;right:0;bottom:0;display:none;z-index:999;
    }
    #confirm{display:none;position:fixed;width:80%;height:210px;margin:-100px 0 0 0;background:#fff;top:50%;left:10%;z-index:9999;border-radius:5px;
    }

    .btn-outline.active{position:relative;top:1px;box-shadow:none!important; }
    .btn-outline:visited{color:#FFF; }
    .btn,.btn:hover, .btn:visited{
        display:block;-webkit-tap-highlight-color:rgba(0,0,0,0);cursor: pointer;-webkit-user-select: none;
        -moz-user-select: none;-ms-user-select: none;user-select: none;border:0;outline:0;
        text-align: center;font-size:16px;color:#fff;
        border-radius: 2px;
    }
    .btn-outline:hover, .btn-outline{background: #7FBE23;color:#fff;border-bottom:1px solid #70AD24!important;}
    .btn-orange{background:#EA4F15;color:#fff!important;border-bottom:1px solid #F73E3E!important;}
    .btn-offline{background: #b0b0b0;border-bottom: 1px solid #999!important;; }
    .btn-orangered{background:#F73E3E;color:#fff!important;border-bottom:1px solid #d51211!important;}
    .btn-orangered2{background:#f74140;color:#fff!important;border-bottom:1px solid #d51211!important;}
    .btn-qing{background: #008B57;color: #fff!important;border-bottom:1px solid #007B4A!important;}
    .inputbox input{width:100%;background:#f1f1f1;height:45px;
        padding: 0 10px;}
    .inputbox input:focus{background:#f1f1f1}
    .inputbox{margin:0 10px}
    .btn{line-height:45px}
</style>
<div id="confirmw"></div>
<div id='confirm'>
    <div style="padding:10px">提现申请</div>
    <div class="inputbox">
        <input type="text" name="cash" id="cash" value="" placeholder="请填写提现金额" >
    </div>
    <a id="submid" class="btn btn-outline">提现</a>
    <a id="submcancel" class="btn btn-offline">取消</a>
</div>

<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    function alert_popup(text){
        $.dialog({
            style:'tip',
            width:200,
            closeTime:500,
            content: '<p style="text-align: center">'+text+'</p>'
        }).open();
    }
    $(function(){
        $('#submcancel').on('click', function(){
            hidepop();
        });
        $('#submid').on('click', function(){
            var c = $.trim($('#cash').val());
            if(c><?php echo $maxmoney?>){
                alert('提现金额不能大于可提现余额');
                return false;
            }

            $.post('<?php echo site_url('mobile/member/cash')?>', {money:c}, function(res){
                alert(res);
                if(res == '提现申请成功'){
                    window.location.href =window.location.href;
                }
            });
        });
    });
function showpop(){
    $('#confirmw').show();
    $('#confirm').show();
    return false;
}
function hidepop(){
    $('#confirmw').hide();
    $('#confirm').hide();
    return false;
}

</script>